🎖️GitЯра🎖️
Node / meshtastic / Meshtastic-Android / files / androidApp / src / main / kotlin / org / meshtastic / app / BubbleActivity.kt
Displaying Raw • Download
androidApp/src/main/kotlin/org/meshtastic/app/BubbleActivity.kt renovate/fastlane-2.x-lockfile (056eed64) Text, 4.07 KB
T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.app
Tff7b72import T7ee787android.content.Intent
Tff7b72import T7ee787android.os.Bundle
Tff7b72import T7ee787androidx.activity.compose.setContent
Tff7b72import T7ee787androidx.appcompat.app.AppCompatActivity
Tff7b72import T7ee787androidx.appcompat.app.AppCompatDelegate
Tff7b72import T7ee787androidx.compose.foundation.isSystemInDarkTheme
Tff7b72import T7ee787androidx.compose.runtime.getValue
Tff7b72import T7ee787androidx.core.net.toUri
Tff7b72import T7ee787androidx.lifecycle.compose.collectAsStateWithLifecycle
Tff7b72import T7ee787org.koin.androidx.viewmodel.ext.android.viewModel
Tff7b72import T7ee787org.meshtastic.core.navigation.DEEP_LINK_BASE_URI
Tff7b72import T7ee787org.meshtastic.core.ui.theme.AppTheme
Tff7b72import T7ee787org.meshtastic.core.ui.theme.MODE_DYNAMIC
Tff7b72import T7ee787org.meshtastic.core.ui.viewmodel.UIViewModel
Tff7b72import T7ee787org.meshtastic.feature.messaging.MessageScreen
Tff7b72import T7ee787org.meshtastic.feature.messaging.MessageViewModel
T8b949e/**
* Hosts a single conversation inside a notification bubble.
*
* Bubbles require their activity to be resizeable, embeddable and document-launched, which the launcher activity cannot
* be without changing how the whole app behaves in recents — so this is a separate, deliberately small host rendering
* only [MessageScreen].
*
* Anything that navigates out of the conversation hands off to the full app rather than just closing: a bubble that
* vanished when you asked for node details would look like a crash. Only back — which for a bubble means "collapse me"
* — finishes on its own.
*/
Tff7b72class T56d364BubbleActivity Tb4b4b4: Te6edf3AppCompatActivityTb4b4b4(Tb4b4b4) Tb4b4b4{
Tff7b72private Tff7b72val Te6edf3modelTb4b4b4: Te6edf3UIViewModel Tff7b72by Te6edf3viewModelTb4b4b4(Tb4b4b4)
Tff7b72private Tff7b72val Te6edf3messageViewModelTb4b4b4: Te6edf3MessageViewModel Tff7b72by Te6edf3viewModelTb4b4b4(Tb4b4b4)
Tff7b72override Tff7b72fun Td2a8ffonCreateTb4b4b4(Te6edf3savedInstanceStateTb4b4b4: Te6edf3Bundle?Tb4b4b4) Tb4b4b4{
Tff7b72superTb4b4b4.Te6edf3onCreateTb4b4b4(Te6edf3savedInstanceStateTb4b4b4)
Tff7b72val Te6edf3contactKey Tff7b72= Te6edf3intentTff7b72?.Te6edf3dataTff7b72?.Te6edf3lastPathSegment
Tff7b72if Tb4b4b4(Te6edf3contactKeyTb4b4b4.Te6edf3isNullOrEmptyTb4b4b4(Tb4b4b4)Tb4b4b4) Tb4b4b4{
Te6edf3finishTb4b4b4(Tb4b4b4)
Tff7b72return
Tb4b4b4}
Te6edf3messageViewModelTb4b4b4.Te6edf3setContactKeyTb4b4b4(Te6edf3contactKeyTb4b4b4)
Te6edf3setContent Tb4b4b4{
Tff7b72val Te6edf3theme Tff7b72by Te6edf3modelTb4b4b4.Te6edf3themeTb4b4b4.Te6edf3collectAsStateWithLifecycleTb4b4b4(Tb4b4b4)
Tff7b72val Te6edf3dark Tff7b72=
Tff7b72when Tb4b4b4(Te6edf3themeTb4b4b4) Tb4b4b4{
Te6edf3AppCompatDelegateTb4b4b4.Te6edf3MODE_NIGHT_YES Tff7b72-Tff7b72> Tff7b72true
Te6edf3AppCompatDelegateTb4b4b4.Te6edf3MODE_NIGHT_NO Tff7b72-Tff7b72> Tff7b72false
Tff7b72else Tff7b72-Tff7b72> Te6edf3isSystemInDarkThemeTb4b4b4(Tb4b4b4)
Tb4b4b4}
Te6edf3AppThemeTb4b4b4(Te6edf3dynamicColor Tff7b72= Te6edf3theme Tff7b72=Tff7b72= Te6edf3MODE_DYNAMICTb4b4b4, Te6edf3darkTheme Tff7b72= Te6edf3darkTb4b4b4) Tb4b4b4{
Te6edf3MessageScreenTb4b4b4(
Te6edf3contactKey Tff7b72= Te6edf3contactKeyTb4b4b4,
Te6edf3message Tff7b72= Ta5d6ff"Ta5d6ff"Tb4b4b4,
Te6edf3viewModel Tff7b72= Te6edf3messageViewModelTb4b4b4,
Te6edf3navigateToNodeDetails Tff7b72= Tb4b4b4{ Te6edf3nodeNum Tff7b72-Tff7b72> Te6edf3openInAppTb4b4b4(Ta5d6ff"Ta5d6ffnodes/Tffd700$Te6edf3nodeNumTa5d6ff"Tb4b4b4) Tb4b4b4}Tb4b4b4,
T8b949e// Quick chat and message filters have no deep link of their own, so the full app opens on this
T8b949e// conversation — the screen those menu items live on.
Te6edf3navigateToQuickChatOptions Tff7b72= Tb4b4b4{ Te6edf3openInAppTb4b4b4(Ta5d6ff"Ta5d6ffmessages/Tffd700$Te6edf3contactKeyTa5d6ff"Tb4b4b4) Tb4b4b4}Tb4b4b4,
Te6edf3navigateToFilterSettings Tff7b72= Tb4b4b4{ Te6edf3openInAppTb4b4b4(Ta5d6ff"Ta5d6ffmessages/Tffd700$Te6edf3contactKeyTa5d6ff"Tb4b4b4) Tb4b4b4}Tb4b4b4,
Te6edf3onNavigateBack Tff7b72= Tb4b4b4{ Te6edf3finishTb4b4b4(Tb4b4b4) Tb4b4b4}Tb4b4b4,
Tb4b4b4)
Tb4b4b4}
Tb4b4b4}
Tb4b4b4}
T8b949e/** Opens [path] in the full app and collapses this bubble behind it. */
Tff7b72private Tff7b72fun Td2a8ffopenInAppTb4b4b4(Te6edf3pathTb4b4b4: Tffa657StringTb4b4b4) Tb4b4b4{
Te6edf3startActivityTb4b4b4(
Te6edf3IntentTb4b4b4(Te6edf3IntentTb4b4b4.Te6edf3ACTION_VIEWTb4b4b4, Ta5d6ff"Tffd700$Te6edf3DEEP_LINK_BASE_URITa5d6ff/Tffd700$Te6edf3pathTa5d6ff"Tb4b4b4.Te6edf3toUriTb4b4b4(Tb4b4b4)Tb4b4b4, Tff7b72thisTb4b4b4, Te6edf3MainActivityTff7b72::Te6edf3classTb4b4b4.Te6edf3javaTb4b4b4)Tb4b4b4.Te6edf3apply Tb4b4b4{
Te6edf3flags Tff7b72= Te6edf3IntentTb4b4b4.Te6edf3FLAG_ACTIVITY_NEW_TASK Te6edf3or Te6edf3IntentTb4b4b4.Te6edf3FLAG_ACTIVITY_SINGLE_TOP
Tb4b4b4}Tb4b4b4,
Tb4b4b4)
Te6edf3finishTb4b4b4(Tb4b4b4)
Tb4b4b4}
Tb4b4b4}
Served by rngit 1.5.2 - Generated in 0.03s